/*
 * UIImage.h
 */

#ifndef UIIMAGE_H_
#define UIIMAGE_H_

#include "UILeaf.h"
#include <string>
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL/SDL_image.h>

/**
 * UI Component for rendering an Image
 */
class UIImage: public UILeaf {
public:
  /**
   * Draws the image into the current OpenGL context
   */
  virtual void draw();

  /**
   * Load an image file as a texture
   * @param file the image file to be loaded
   */
  virtual bool load(std::string& file) = 0;

protected:
  /**
   * Path and name of the image file
   */
  std::string _file;

  /**
   * Texture ID of the image file in the current OpenGL context
   */
  GLuint _tex;
};

#endif /* UIIMAGE_H_ */
